package com.rnkrsoft.suyan.config.server.config.entity;

import com.rnkrsoft.framework.orm.PrimaryKey;
import com.rnkrsoft.framework.orm.jdbc.*;
import com.rnkrsoft.suyan.config.internal.enums.ParamStatusEnum;
import com.rnkrsoft.suyan.config.internal.enums.YesOrNo;
import com.rnkrsoft.suyan.config.protocol.v2.DataTypeEnum;
import com.rnkrsoft.suyan.config.protocol.v2.ParamType;
import lombok.*;
/**
 * Created by woate on 2018/5/13.
 */
@Data
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "OPERATE_HISTORY_PARAM", prefix = "TB")
@Comment("操作历史参数表")
public class OperateHistoryParamEntity extends BaseEntity{
    @PrimaryKey
    @StringColumn(name = "HIS_PARAM", nullable = false)
    @Comment("历史参数主键")
    String hisParam;

    @StringColumn(name = "OPERATE_ID", nullable = false)
    @Comment("操作编号")
    String operateId;

    @StringColumn(name = "PARAM_ID", nullable = false)
    @Comment("参数编号")
    String paramId;

    @StringColumn(name = "PROJECT_ID", nullable = false)
    @Comment("项目编号")
    String projectId;

    @StringColumn(name = "VERSION_ID", nullable = false)
    @Comment("版本编号")
    String versionId;

    @StringColumn(name = "ENVIRONMENT_ID", nullable = false)
    @Comment("环境编号")
    String environmentId;

    @StringColumn(name = "MACHINE_ID", nullable = false)
    @Comment("机器编号")
    String machineId;

    @StringColumn(name = "PARAM_NAME")
    @Comment("参数名称")
    String paramName;

    @StringColumn(name = "PARAM_VALUE", type = StringType.TEXT, nullable = true)
    @Comment("参数值")
    String paramValue;

    @NumberColumn(name = "PARAM_EXTENDS", defaultValue = "2", enumClass = YesOrNo.class)
    @Comment("参数是否为继承参数，引用值意味着有依赖项目")
    Integer paramExtends;

    @NumberColumn(name = "PARAM_DATA_TYPE", defaultValue = "3", enumClass = DataTypeEnum.class)
    @Comment("参数数据类型")
    Integer paramDataType;

    @NumberColumn(name = "PARAM_TYPE", defaultValue = "2", enumClass = ParamType.class)
    @Comment("参数类型")
    Integer paramType;

    @NumberColumn(name = "PARAM_VERSION", defaultValue = "1")
    @Comment("参数版本，默认从1开始自增")
    Integer paramVersion;

    @NumberColumn(name = "PARAM_DYNAMIC", defaultValue = "1")
    @Comment("参数是否为动态参数，默认为动态参数")
    Integer paramDynamic;


    @NumberColumn(name = "PARAM_SYSTEM_PROPERTIES", defaultValue = "1")
    @Comment("参数是否同步到Java systemProperties中")
    Integer paramSystemProperties;

    @NumberColumn(name = "PARAM_STATUS", defaultValue = "1", enumClass = ParamStatusEnum.class)
    @Comment("参数状态,默认为正常 禁用，正常")
    Integer paramStatus;

    @NumberColumn(name = "PARAM_ENCRYPT", defaultValue = "1")
    @Comment("参数是否加密")
    Integer paramEncrypt;

    @StringColumn(name = "PARAM_DESC", nullable = true)
    @Comment("参数描述")
    String paramDesc;

    @StringColumn(name = "PARAM_CREATOR")
    @Comment("参数创建者")
    String paramCreator;

    @StringColumn(name = "PARAM_LAST_UPDATER")
    @Comment("参数最近更新人")
    String paramLastUpdater;
}
